<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="shortcut icon" href="__IMG__/favicon.ico" />
		<link rel="bookmark" href="__IMG__/favicon.ico" type="image/x-icon" 　/>
		<title>登录</title>
	</head>
	<style type="text/css">
		*{
			padding: 0;
			margin: 0;
		}
		a{
			text-decoration: none;
		}
		body{
			font-family: "微软雅黑";
			width: 100%;
			background: url(__IMG__/bg1.png)no-repeat;
			background-size:100% 100% ;
		}
		label{
			display: inline-block;
			color: #fff;
			width: 50px;
			text-align: right;
		}
		input{
			width:60%;
			height: 50px;
			line-height: 50px;
			border: none;
			box-shadow: 0px 0px 10px 0px rgba(255, 255, 255, .8);
			border-radius: 30px;
			background: url(__IMG__/bg_inp.png)no-repeat;
			background-size:100% 100%;
			padding:0 10px;
			color: #fff;
		}
		input:focus{
			outline: none;
		}
		.login_box{
			text-align: center;
			padding-top: 40px;
		}
		.login_box:first-child{
			padding-top: 150px;
		}
		.login_box a{
			display: inline-block;
			width: 70%;
			height: 40px;
			text-align: center;
			line-height: 40px;
			color: #8D8100;
			font-weight: 900;
			background: #FFEC18;
			box-shadow: 5px 5px 2px rgba(0,0,0,.2);
			border-radius: 20px;
			margin: 10px;
		}
		::-webkit-input-placeholder{
			color: #FFEC19;
		}
	</style>
	<body>
		<div class="login_box">
			<label for="">用户名</label>
			<input type="number" name="mobile" id="mobile" value="" placeholder="请填写手机号码" />
		</div>
		<div class="login_box">
			<label for="">密码</label>
			<input type="password" name="password" id="password" value="" placeholder="请填写用户密码" />
		</div>
		<div class="">
			<a href="{:url('login/forget_password')}" style="color: #555;font-size: 12px;margin:10px 0 0 75%">忘记密码？</a>

		</div>
		<div class="login_box">
			<a href="#" onclick="do_login()">登录</a>
			<a href="{:url('login/register')}">注册</a>
		</div>
	</body>
	<script src="__JS__/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="__JS__/layer.js" ></script>
	<script src="__JS__/rooms.js" ></script>
	<script type="text/javascript">
		$("body").css("height",$(document).height());
        function do_login() {
            var mobile   = $('#mobile').val();
            var password = $('#password').val();
            if(!(/^1[34578]\d{9}$/.test(mobile))){
                 my_error("手机号码格式有误");
                return false;
            }
            $.ajax({
                type: "post",
                url: "{:url('do_login')}",
                data: {'mobile':mobile,'password':password},
                dataType: "json",
                async: false,
                success: function(data) {
                    var ret  = data.ret;
                    var info = data.msg;
					if(ret=='200'){
                         my_error(info);
                        window.location.href = "{:url('index/index')}"
					}else {
                         my_error(info);
                    }
                }
            });
        }
	</script>
</html>
